<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*" %>
<%@ page import="com.ionglobal.lib.*" %>
<%@ page import="com.ionglobal.db.*" %>
<%@ page import="com.ionglobal.dba.*" %>
<%@ page import="com.ionglobal.misc.*" %>
<%@ page import="java.sql.*" %>
<%@ include file="../init_include.jsp" %>
<html>
<head>
<title>phpMyAdmin</title>
<link rel="stylesheet" href="./dbo.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=<%=Language.getHTMLLanguageStr()%>">
</head>

<body bgcolor="#F5F5F5" text="#000000" background="images/bkg.gif">
<% String catalog="",tablename="";
	catalog=request.getParameter("db");
	tablename=request.getParameter("table");
%>
	<%
		String filename="";
		Vector vc=null;
		vc=Database.getColumnList(dbi,catalog,tablename);
		filename=SysEnv.get("web.fileRoot")+"/admin/temp/"+DBField.getTableName(vc)+".txt";
		int j=vc.size();
		String element[]=new String[j];
		Properties p=new Properties();
		try {
			p=PropertiesUtil.load(filename);
		} catch(Exception E)
		{
			out.print(E.getMessage());
		}
		if(p==null)
			p=new Properties();
	%>
   <table border="1" cellspacing="0" cellpadding="0">
   	<tr>
   		<td colspan="2">&nbsp;&nbsp;Database</td>
   		<td colspan="6">&nbsp;&nbsp;<%=catalog%></td>
   	</tr>
   	<tr>
   		<td colspan="2">&nbsp;&nbsp;Table Name</td>
   		<td colspan="6">&nbsp;&nbsp;<%=tablename%></td>
   	</tr>
   	<tr>
   		<td colspan="2">&nbsp;&nbsp;Description</td>
   		<td colspan="6">&nbsp;&nbsp;<%=p.get(tablename)%></td>
   	</tr>
   <TR>
   <TD align="center">Key</TD>
   <TD align="center">Field ID</TD>
   <TD align="center">Field Name</TD>
   <TD align="center">Type</TD>
   <TD align="center">Length</TD>
   <TD align="center">Null</TD>
   <TD align="center">Deafult Value</TD>
   <TD align="center">Description</TD>
   </TR>
  <%
		for(int i=0;i<j;i++)
		{
			DBColumn column=(DBColumn)vc.get(i);
	%>
   <tr>     
     <td><%=(i==0?"*":"")%></td>
     <td><%=column.getCOLUMN_NAME()%></td>
     <td><%=column.getCOLUMN_NAME()%></td>
     <td><%=column.getTYPE_NAME()%></td>
     <td><%=column.getCOLUMN_SIZE()%></td>
		 <td><%=column.getIS_NULLABLE()%></td>
     <td><%=column.getCOLUMN_DEF()==null?"Null":column.getCOLUMN_DEF()%></td>
     <td><%=p.get(column.getCOLUMN_NAME())%></td>
    </tr>
  <%}
 %>
  </table>
</body>
</html>
<%@ include file="../init_free.jsp" %>
